﻿<Page
    x:Class="Pear.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Pear"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.BottomAppBar>
        <CommandBar>
            <AppBarButton Icon="Add" Label="Add"/>
            <AppBarButton Icon="Find" Label="Find"/>
            <AppBarButton Icon="Setting" Label="Setting"/>
        </CommandBar>
    </Page.BottomAppBar>
    <Grid x:Name="LayoutRoot" Loaded="LayoutRoot_Loaded">

        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TODO: Content should be placed within the following grid-->
        <Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
            <Grid.Resources>
                <DataTemplate x:Key="kContactsListViewItem">
                    <Grid Tapped="Grid_Tapped">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Image Grid.Column="0"/>
                        <StackPanel Grid.Column="1">
                            <TextBlock Text="{Binding LiaisonName}"/>
                            <TextBlock Text="消息"/>
                        </StackPanel>
                        <TextBlock Grid.Column="3" Text="时间"/>
                    </Grid>
                </DataTemplate>
            </Grid.Resources>
            <Pivot>
                <PivotItem Header="会话">
                    <ListView x:Name="nSession" ItemTemplate="{StaticResource kContactsListViewItem}">
                    </ListView>
                </PivotItem>
                <PivotItem  Header="联系人">
                    <ListView x:Name="xContacts" ItemTemplate="{StaticResource kContactsListViewItem}" ItemClick="xContacts_ItemClick" IsItemClickEnabled="True">
                    </ListView>
                </PivotItem>
            </Pivot>
        </Grid>
    </Grid>
</Page>
